// 主题颜色
$primary-color: #3b82f6;
$secondary-color: #10b981;
$background-color: #f8fafc;
$card-background: #ffffff;
$text-primary: #1e293b;
$text-secondary: #64748b;
$border-color: #e2e8f0;
$hover-color: #f1f5f9;
$shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
$shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

// 重置样式
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: $text-primary;
  background-color: $background-color;
}

#app {
  width: 100%;
  height: 100%;
}

// 主布局
.page_main {
  display: flex;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: $background-color;
  gap: 1px;

  // 左侧面板
  .left {
    width: 30%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: $card-background;
    box-shadow: $shadow-md;
    z-index: 10;

    .manager {
      flex: 1;
      overflow-y: auto;
      padding: 1.5rem;
      background: linear-gradient($card-background 30%, rgba(255, 255, 255, 0)), 
                linear-gradient(rgba(255, 255, 255, 0), $card-background 70%) 0 100%, 
                radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0)),
                radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0)) 0 100%;
      background-repeat: no-repeat;
      background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
      background-attachment: local, local, scroll, scroll;

      &::-webkit-scrollbar {
        width: 6px;
      }

      &::-webkit-scrollbar-track {
        background: transparent;
      }

      &::-webkit-scrollbar-thumb {
        background: $text-secondary;
        border-radius: 3px;
        
        &:hover {
          background: darken($text-secondary, 10%);
        }
      }
    }

    .global-button {
      padding: 1rem 1.5rem;
      border-top: 1px solid $border-color;
      display: flex;
      gap: 0.75rem;
      justify-content: center;
      background: $card-background;

      button {
        padding: 0.75rem 1.5rem;
        border: none;
        border-radius: 0.5rem;
        font-weight: 500;
        font-size: 0.875rem;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        box-shadow: $shadow-sm;

        &:first-child {
          background: $primary-color;
          color: white;

          &:hover {
            background: darken($primary-color, 5%);
            transform: translateY(-1px);
            box-shadow: $shadow-md;
          }
        }

        &:last-child {
          background: $secondary-color;
          color: white;

          &:hover {
            background: darken($secondary-color, 5%);
            transform: translateY(-1px);
            box-shadow: $shadow-md;
          }
        }
      }
    }
  }

  // 右侧面板
  .right {
    width: 70%;
    height: 100%;
    overflow-y: auto;
    background-color: $background-color;
    padding: 2rem;
    display: flex;
    justify-content: center;

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-track {
      background: transparent;
    }

    &::-webkit-scrollbar-thumb {
      background: $text-secondary;
      border-radius: 3px;
      
      &:hover {
        background: darken($text-secondary, 10%);
      }
    }

    .template {
      width: 210mm;
      min-height: 297mm;
      background: $card-background;
      box-shadow: $shadow-md;
      margin: 0 auto;
      padding: 20mm;
      border-radius: 4px;
      transition: transform 0.3s ease;

      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
      }
    }
  }
}

// 分隔线样式
.hr-double-arrow {
  display: none;
}

// 响应式布局
@media screen and (max-width: 1200px) {
  .page_main {
    position: relative;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    
    .left, .right {
      width: 100%;
      height: auto;
    }
    
    .left {
      position: relative;
      
      .manager {
        max-height: 50vh;
      }
    }
    
    .right {
      padding: 1rem;
      
      .template {
        width: 100%;
        padding: 1rem;
        margin: 1rem 0;
      }
    }
  }
}

// 打印样式优化
@media print {
  html, body, #app {
    height: auto;
    overflow: visible;
  }

  .page_main {
    position: relative;
    height: auto;
    display: block;
    background: white;
    
    .left {
      display: none;
    }
    
    .right {
      width: 100%;
      height: auto;
      padding: 0;
      overflow: visible;
      
      .template {
        width: 100%;
        min-height: auto;
        padding: 0;
        box-shadow: none;
        margin: 0;
      }
    }
  }
}
